<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .title {
            color: green;
        }

        .boxs {
            background-color: yellow;
        }
    </style>
</head>

<body>
    <div id="test"></div>
    <div id="box"></div>

    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
    <script type="text/babel">
        /*
        一定注意区分 :【js语句()代码】与【js表达式】
          1.表达式：一个表达式会产生一个值.可以放在任何一个需要指的地方
             下面这些都是表达式
             (1).a
             (2).a+b
             (3).demo(1)
             (4).arr.map() //数组方法
             (4).function.test() //函数
          2.语句(语句)
            //下面这些都是语句(代码)
              (1) .if(){}
              (2) .for(){}
              (3) .switch(){case:xxx}
        */
        const data = ["Angular", "React", "Vue"]
        // 模拟一些数据
        const myId = "state"
        const name = "张三"
        const VDOM = (
            <div>
                <h1>前端三大框架</h1>
                <ul>
                    {
                        data.map((item, i) => {
                            return <li key={i}>{item}</li>
                        })
                    }
                </ul>
            </div>
        )

        const VBOX = (
            <div className="boxs" style={{ color: 'red' }}>
                <div>11111</div>
                <div>狗子你变了</div>
                <div>{name}</div>
            </div>
        )

        ReactDOM.render(VDOM, document.getElementById('test'))
        ReactDOM.render(VBOX, document.getElementById('box'))
    </script>
</body>

</html>